/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spiele.RPS.base;

import spiele.RPS.Rps;

/**
 *  this help find the object in a collection
 * @author martin
 */
public abstract class RpsBase<E, M> implements Rps<E, M>{

  @Override
  public boolean equals(Object other){
    if (other instanceof Rps){
      return ((Rps)other).strong()==strong() && 
             ((Rps)other).weak()==weak();
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = 67 * hash + (this.strong() != null ? this.strong().hashCode() : 0);
    hash = 67 * hash + (this.weak() != null ? this.weak().hashCode() : 0);
    return hash;
  }
  
  @Override
  public String toString(){
    return strong().toString() + " " + modif().toString() + " " + weak().toString();
  }
}
